@RestController
public class ConsumerController {
    
    /**
     * TODO 前台页面调用  登录
     * 登录判断
     */
    @PostMapping("/user/login/status")
    public R loginStatus(@RequestBody ConsumerRequest loginRequest, HttpSession session) {
        R result = consumerService.loginStatus(loginRequest, session);
        //登录成功的话，返回中需要包含token信息
        if(result.getSuccess()){
            String tokenStr = JwtUtils.generateToken(loginRequest.getUsername());
            Result token = new Result();
            token.setAuthorization(tokenStr);
            token.setObj(result.getData());
            result.setData(token);
        }
        return result;
    }

}
